package com.lyl.security.module.login.controller;

import com.lyl.security.module.login.model.dto.UserDTO;
import com.lyl.security.module.login.service.LoginService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author Mr.Luo
 * @date 2022-09-13 16:05
 * @desc 登录控制器
 */
@RestController
@RequiredArgsConstructor
public class LoginController {
    private final LoginService loginService;

    @PostMapping("/login")
    public String login(@RequestBody @Valid UserDTO dto) {
        return loginService.login(dto);
    }
}
